package com.marvelution.samples.springmetadataattributes;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Log logger = LogFactory.getLog(Main.class);
		ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
		        new String[] {"applicationContext.xml"});
		WithAttributes classWithAttributes = (WithAttributes) appContext.getBean("classWithAttributes");
		WithAttributes methodWithAttributes = (WithAttributes) appContext.getBean("methodWithAttributes");
		
		logger.info("Calling ClassWithAttributes.someMethod()");
		classWithAttributes.someMethod();
		logger.info("Calling ClassWithAttributes.someOtherMethod()");
		classWithAttributes.someOtherMethod();
		
		logger.info("Calling MethodWithAttributes.someMethod()");
		methodWithAttributes.someMethod();
		logger.info("Calling MethodWithAttributes.someOtherMethod()");
		methodWithAttributes.someOtherMethod();
	}

}
